
ENT.Type = "anim"

function ENT:TrackEntity( ent )

	if ( !ent || !ent:IsValid() ) then return end
	
	--[[local WPos = ent:GetPos()
	WPos.y = 64;
	WPos = WPos + Vector( 0, 0, 64 )

	if (self.Entity:GetPos() - WPos):Length() > 100 then		self.Entity:SetPos(WPos)	Msg("to far away!\n")	end
	
	local v = ent:GetVelocity()
	v.y = 0
	
	local adjustVec = Vector(self.Entity:GetPos().x, self.Entity:GetPos().y, WPos.z)

	if (v.z == 0) then
		self.Entity:SetPos( adjustVec )
	end
	
	if (SERVER) then
		self.Entity:SetLocalVelocity( v )
	end
	
	local Ang = ent:GetPos() - WPos
	Ang = Ang:Angle()
	//Ang.Pitch = 0
	self.Entity:SetAngles(Ang)]]
	
	local offset = self.Entity:GetNetworkedVector( "Offset", Vector() )
	
	local vpos = ent:GetForward() * offset.x
	vpos = vpos + ent:GetRight() * offset.y
	vpos = vpos + ent:GetUp() * offset.z
	
	local ppos = vpos + ent:GetPos()
	
	local ang = (ent:GetPos() - ppos):Normalize()
	if ent:IsPlayer() then
		ang = ent:GetAimVector()
	end
	
	ang = ang:Angle()
	self.Entity:SetAngles(ang)
	
	if ppos != self.Entity:GetPos() then
		self.Entity:SetPos(ppos)
	end
	
	if (SERVER) then
		self.Entity:SetLocalVelocity( ent:GetVelocity() )
	end

end